package homework;

/**
 * @classname:demo01
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/8 17:21
 * @version: 0.1
 * @since:1.8
 */
public class demo01 {
    public static void main(String[] args) {
        String email = "123456789@163.com";
        String emainRegex = "^\\w{6,}@\\w{2,}.[a-z]{2,3}$";
        if (!email.matches(emainRegex)) {
            throw new RuntimeException(email + "不是一个合法的字符");
        }
        System.out.println(email + "是一个合法的邮箱地址");
        String emailRegex = "\\w{6,}@sina.com";
        if (!email.matches(emailRegex)) {
            throw new RuntimeException(email + "不是一个合法的sina邮箱");
        }
        System.out.println(email + "是一个合法的sina邮箱地址");

        String eials = "^\\w{6,}@\\w{2,}.[a-z]{2,3}$";
    }
}
